package com.lx.base.util;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;

/**
 * 获取Spring Bean工具类
 * @author w050000154
 */
@Component
public class SpringContextUtil implements ApplicationContextAware {

	public static ApplicationContext applicationContext = null;



	/**
	 * 需要手动注入，才可以使用
	 * @param applicationContext
	 * @throws BeansException
	 */
	@Override
	public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
		SpringContextUtil.applicationContext = applicationContext;
	}





}
